import { createRouter, createWebHistory } from 'vue-router'
// 王紫冰
import Login from '../views/WZB/Login.vue'
import Check from '../views/WZB/Check.vue'
import Callback from '../views/WZB/Callback.vue'
import Faceo from '../views/WZB/Faceo.vue'
import Facet from '../views/WZB/Facet.vue'
import Facethree from '../views/WZB/Facethree.vue'
import Lost from '../views/WZB/Lost.vue'
import Zhuce from '../views/WZB/Zhuce.vue'
import Dol from '../views/WZB/Dol.vue'
import Sfz from '../views/WZB/Sfz.vue'
import Aiduihua from '../views/WZB/Aiduihua.vue'
// 栗陆强
import LLQxq from '../views/LLQ/LLQxq.vue'
import LLQss from '../views/LLQ/LLQss.vue'
//崔张豪
import Detail from '../views/TJL/Detail.vue'
import Map from '../views/CZH/Map.vue'
import Run from '../views/CZH/Run.vue'

// 使用基本类型定义路由配置2
const routes = [
  {
    path: '/',
    redirect: '/dol' // 添加根路径重定向到home
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/WZB/Home.vue')
  },
  
  {
    path: '/community',
    name: 'Community',
    component: () => import('../views/TJL/Community.vue')
  },
  {
    path: '/video',
    name: 'Video',
    component: () => import('../views/LLQ/Video.vue')
  },
  {
    path: '/llqxq/:id',
    name: 'LLQxq',
    component: LLQxq
  },
  {
    path: '/llqss',
    name: 'LLQss',
    component: LLQss
  },
  {
    path: '/sport',
    name: 'Sport',
    component: () => import('../views/CZH/Sport.vue')
  },
  //刘琳泽
  {
    path:'/my',
    name:'My',
    component: () => import('../views/LLZ/My.vue')
  },
  {
    path:'/mynotes',
    name:'Mynotes',
    component: () => import('../views/LLZ/MyNotes.vue')
  },
  {
    path:'/AIChat',
    name:'AIChat',
    component: () => import('../views/LLZ/AIChat.vue')
  },
  {
    path: '/detail',
    name: 'Detail',
    component: Detail
  },
  {
    path: '/map',
    name: 'Map',
    component: Map
  },
  {
    path:'/run',
    name:'Run',
    component:Run
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/check',
    name: 'Check',
    component: Check
  },
  {
    path: '/callback',
    name: 'Callback',
    component: Callback
  },
  {
    path: '/faceo',
    name: 'faceo',
    component: Faceo
  },
  {
    path: '/facet',
    name: 'facet',
    component: Facet
  },
  {
    path: '/facethree',
    name: 'facethree',
    component: Facethree
  },
  {
    path: '/lost',
    name: 'Lost',
    component: Lost
  },
  {
    path: '/zhuce',
    name: 'Zhuce',
    component: Zhuce
  },
  {
    path: '/checkout',
    name: 'Checkout',
    component: () => import('../views/LLZ/Checkout.vue')
  },
  {
    path: '/dol',
    name: 'Dol',
    component: Dol
  },
  {
    path: '/aiduihua',
    name: 'Aiduihua',
    component: Aiduihua
  },
  {
    path: '/sfz',
    name: 'Sfz',
    component: Sfz
  },
  {
    path: '/shop',
    name: 'Shop',
    component: () => import('../views/LLZ/Shop.vue')
  },
  {
    path: '/product/:id',
    name: 'ProductDetail',
    component: () => import('../views/LLZ/ProductDetail.vue')
  },
  {
    path: '/chat',
    name: 'Chat',
    component: () => import('../views/TJL/Chat.vue')
  }
]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/dol',
      component: () => import('../views/WZB/Home.vue') // 添加一个组件以满足类型要求
    },
    ...routes.slice(1)
  ] as import('vue-router').RouteRecordRaw[]
})

export default router